package com.lemeng.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.lemeng.dao.CategoryReportMapper;
import com.lemeng.pojo.CategoryReport;
import com.lemeng.service.CategoryReportService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service(interfaceClass = CategoryReportService.class)
public class CategoryReportServiceImpl implements CategoryReportService {


    @Autowired
    CategoryReportMapper categoryReportMapper;

    @Override
    public void initAddAllData() {
        List<CategoryReport> allData = categoryReportMapper.findAllData();

        for (CategoryReport allDatum : allData) {
            categoryReportMapper.insert(allDatum);
        }

    }

    @Override
    public List<CategoryReport> findList(String date1,String date2) {
        return categoryReportMapper.findDataForPage(date1,date2);
    }

    @Override
    public void add(CategoryReport categoryReport) {

    }

    @Override
    public List<CategoryReport> findCunrrentDateData(String date) {
        List<CategoryReport> allData = categoryReportMapper.findCunrrentDateData(date);
        return allData;
    }
}
